﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CSharpDemo
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }
        //实例化电脑
        DianNao mypc = new DianNao();

        private void btnZuzhuang_Click(object sender, EventArgs e)
        {
            //设置CPU 
            CPU intel = new CPU();
            mypc.myCpu = intel;
            //设置内存
            mypc.myNeiCun = new Neicun();
            //设置主板
            mypc.myZhuban = new Zhuban();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            mypc.PowerOn();//
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //设置电源
            mypc.power = new Dianyuan();
        }
    }
}
